import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/auth/login',
    method: 'post',
    data
  })
}
export function oidcLogin(data) {
  return request({
    url: '/api/sso/code',
    method: 'post',
    data
  })
}
export function getInfo(token) {
  return request({
    url: '/api/auth/get_userinfo',
    method: 'get',
    params: { token }
  })
}

export function clearCatch() {
  return request({
    url: '/api/cache/clear',
    method: 'get'
  })
}

export function getMenu(is_role = 1) {
  return request({
    url: '/api/auth/getmenu',
    method: 'get',
    params: { is_role }
  })
}
export function getRouteMenu() {
  return request({
    url: '/api/route/tree',
    method: 'get'
  })
}
export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}
